package com.myself.mapper;

import com.myself.entity.Permission;
import com.myself.entity.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Description:
 *
 * @Author: Liuzemin
 * @Date: 2020/7/10 13:42
 */
public interface RoleMapper {
    Role findById(Long id);

    void create(Role role);

    void update(Role role);

    List<Role> findAll();

    void deleteUserRole(Long roleId);

    void deleteRole(Long roleId);

    void updateUserRole_Id(Role role);

    void deleteAllRolePermissions(Long id);

    void correlationPermissions(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    boolean exists(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    List<Permission> findPermissionByRoleId(Long id);

    List<Permission> findRolePermissionByRoleId(Long id);
}
